Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-repack(1) |
| 2 | ============= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-repack - Pack unpacked objects in a repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 11 | 'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | |
| 16 | This script is used to combine all objects that do not currently |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 17 | reside in a "pack", into a pack. It can also be used to re-organize |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 18 | existing packs into a single, more efficient pack. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 19 | |
| 20 | A pack is a collection of objects, individually compressed, with |
| 21 | delta compression applied, stored in a single file, with an |
| 22 | associated index file. |
| 23 | |
| 24 | Packs are used to reduce the load on mirror systems, backup |
| 25 | engines, disk storage, etc. |
| 26 | |
| 27 | OPTIONS |
| 28 | ------- |
| 29 | |
| 30 | -a:: |
| 31 | Instead of incrementally packing the unpacked objects, |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 32 | pack everything referenced into a single pack. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 33 | Especially useful when packing a repository that is used |
Junio C Hamano | 9cb74f2 | 2007-02-12 04:15:05 | [diff] [blame] | 34 | for private development and there is no need to worry |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 35 | about people fetching via dumb protocols from it. Use |
| 36 | with '-d'. This will clean up the objects that `git prune` |
| 37 | leaves behind, but `git fsck --full` shows as |
| 38 | dangling. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 39 | |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 40 | -A:: |
Junio C Hamano | bba37ad | 2008-11-16 17:47:59 | [diff] [blame] | 41 | Same as `-a`, unless '-d' is used. Then any unreachable |
| 42 | objects in a previous pack become loose, unpacked objects, |
| 43 | instead of being left in the old pack. Unreachable objects |
| 44 | are never intentionally added to a pack, even when repacking. |
| 45 | This option prevents unreachable objects from being immediately |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 46 | deleted by way of being left in the old pack and then |
| 47 | removed. Instead, the loose unreachable objects |
| 48 | will be pruned according to normal expiry rules |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 49 | with the next 'git-gc' invocation. See linkgit:git-gc[1]. |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 50 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | -d:: |
| 52 | After packing, if the newly created packs make some |
| 53 | existing packs redundant, remove the redundant packs. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 54 | Also run 'git-prune-packed' to remove redundant |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 55 | loose object files. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 56 | |
| 57 | -l:: |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 58 | Pass the `--local` option to 'git-pack-objects'. See |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 59 | linkgit:git-pack-objects[1]. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 60 | |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 61 | -f:: |
Junio C Hamano | 7cc9129 | 2008-09-20 16:55:38 | [diff] [blame] | 62 | Pass the `--no-reuse-object` option to `git-pack-objects`, see |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 63 | linkgit:git-pack-objects[1]. |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 64 | |
| 65 | -q:: |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 66 | Pass the `-q` option to 'git-pack-objects'. See |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 67 | linkgit:git-pack-objects[1]. |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 68 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 69 | -n:: |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 70 | Do not update the server information with |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 71 | 'git-update-server-info'. This option skips |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 72 | updating local catalog files needed to publish |
| 73 | this repository (or a direct copy of it) |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 74 | over HTTP or FTP. See linkgit:git-update-server-info[1]. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 75 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 76 | --window=[N]:: |
| 77 | --depth=[N]:: |
Junio C Hamano | 93567a6 | 2006-10-08 08:47:56 | [diff] [blame] | 78 | These two options affect how the objects contained in the pack are |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 79 | stored using delta compression. The objects are first internally |
| 80 | sorted by type, size and optionally names and compared against the |
| 81 | other objects within `--window` to see if using delta compression saves |
| 82 | space. `--depth` limits the maximum delta depth; making it too deep |
| 83 | affects the performance on the unpacker side, because delta data needs |
| 84 | to be applied that many times to get to the necessary object. |
Junio C Hamano | 91d44c5 | 2007-05-09 07:16:07 | [diff] [blame] | 85 | The default value for --window is 10 and --depth is 50. |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 86 | |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 87 | --window-memory=[N]:: |
| 88 | This option provides an additional limit on top of `--window`; |
| 89 | the window size will dynamically scale down so as to not take |
| 90 | up more than N bytes in memory. This is useful in |
| 91 | repositories with a mix of large and small objects to not run |
| 92 | out of memory with a large window, but still be able to take |
| 93 | advantage of the large window for the smaller objects. The |
| 94 | size can be suffixed with "k", "m", or "g". |
| 95 | `--window-memory=0` makes memory usage unlimited, which is the |
| 96 | default. |
| 97 | |
Junio C Hamano | 591dc6a | 2007-05-29 09:18:19 | [diff] [blame] | 98 | --max-pack-size=<n>:: |
| 99 | Maximum size of each output packfile, expressed in MiB. |
| 100 | If specified, multiple packfiles may be created. |
| 101 | The default is unlimited. |
| 102 | |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 103 | |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 104 | Configuration |
| 105 | ------------- |
| 106 | |
| 107 | When configuration variable `repack.UseDeltaBaseOffset` is set |
| 108 | for the repository, the command passes `--delta-base-offset` |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 109 | option to 'git-pack-objects'; this typically results in slightly |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 110 | smaller packs, but the generated packs are incompatible with |
| 111 | versions of git older than (and including) v1.4.3; do not set |
| 112 | the variable in a repository that older version of git needs to |
| 113 | be able to read (this includes repositories from which packs can |
| 114 | be copied out over http or rsync, and people who obtained packs |
| 115 | that way can try to use older git with it). |
| 116 | |
| 117 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | Author |
| 119 | ------ |
| 120 | Written by Linus Torvalds <torvalds@osdl.org> |
| 121 | |
| 122 | Documentation |
| 123 | -------------- |
| 124 | Documentation by Ryan Anderson <ryan@michonline.com> |
| 125 | |
Junio C Hamano | 9049d91 | 2008-05-29 02:09:50 | [diff] [blame] | 126 | SEE ALSO |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 127 | -------- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 128 | linkgit:git-pack-objects[1] |
| 129 | linkgit:git-prune-packed[1] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 130 | |
| 131 | GIT |
| 132 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 133 | Part of the linkgit:git[1] suite |